cmake_minimum_required(VERSION 3.10)
project(CardGame)

# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 编译选项
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -O2")
endif()

# 查找所有源文件
file(GLOB_RECURSE SOURCES 
    "*.cpp"
    "Classes/*.cpp"
    "Classes/*/*.cpp"
)

# 创建可执行文件
add_executable(CardGame ${SOURCES})

# 在 GitCode 环境中的特定设置
if(UNIX AND NOT APPLE)
    find_package(Threads REQUIRED)
    target_link_libraries(CardGame Threads::Threads)
endif()

message(STATUS "🎯 纸牌游戏项目配置完成")
message(STATUS "📁 源文件数量: ${SOURCES}")